<template>
    <div class="chat-time">{{ chatTime(time) }}</div>
</template>

<script setup lang="ts">
import dayjs from 'dayjs'
import { chatTime } from '@/utils/time.ts'

//获取父组件传递过来的全部数据
let props = defineProps({
    message: Number,
})
let time: any = dayjs(props.message)
</script>

<style scoped lang="scss">
.chat-time {
    width: fit-content;
    height: 1.6rem;
    font-size: 1rem;
    line-height: 1.6rem;
    text-align: center;
    margin: 1.5rem auto 0 auto;
    padding: 0 0.3rem;
    @include flex-layout(flex, center, center);
    background-color: rgb(229, 229, 229);
    cursor: default;
}
</style>
